package Day35.listTest.Test;

/**
 * @author hyhWTX
 * @version 1.0
 * @ClassName Book
 * @date 2022年08月05日 11:44
 * @Description: 书籍类
 */
public class Book1 implements Comparable<Book1>{
    private int bookid;
    private String bookname;
    private  int bookprices;

    public Book1() {
    }

    public Book1(int bookid, String bookname, int bookprices) {
        this.bookid = bookid;
        this.bookname = bookname;
        this.bookprices = bookprices;
    }

    public int getBookid() {
        return bookid;
    }

    public void setBookid(int bookid) {
        this.bookid = bookid;
    }

    public String getBookname() {
        return bookname;
    }

    public void setBookname(String bookname) {
        this.bookname = bookname;
    }

    public int getBookprices() {
        return bookprices;
    }

    public void setBookprices(int bookprices) {
        this.bookprices = bookprices;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bookid=" + bookid +
                ", bookname='" + bookname + '\'' +
                ", bookprices=" + bookprices +
                '}';
    }

    @Override
    public int compareTo(Book1 book1) {
        return this.getBookid()-book1.getBookid();
    }
}
